3.3.46 \(\int \frac {(c+\frac {d}{x})^2}{\sqrt {a+\frac {b}{x}}} \, dx\) [246]

Optimal. Leaf size=73 \[ -\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}-\frac {c (b c-4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}} \]

[Out]

-c*(-4*a*d+b*c)*arctanh((a+b/x)^(1/2)/a^(1/2))/a^(3/2)-2*d^2*(a+b/x)^(1/2)/b+c^2*x*(a+b/x)^(1/2)/a

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 73, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {382, 91, 81, 65, 214} \begin {gather*} -\frac {c (b c-4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}}+\frac {c^2 x \sqrt {a+\frac {b}{x}}}{a}-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d/x)^2/Sqrt[a + b/x],x]

[Out]

(-2*d^2*Sqrt[a + b/x])/b + (c^2*Sqrt[a + b/x]*x)/a - (c*(b*c - 4*a*d)*ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/a^(3/2)

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 81

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rule 91

Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*c - a*d
)^2*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d^2*(d*e - c*f)*(n + 1))), x] - Dist[1/(d^2*(d*e - c*f)*(n + 1)), In
t[(c + d*x)^(n + 1)*(e + f*x)^p*Simp[a^2*d^2*f*(n + p + 2) + b^2*c*(d*e*(n + 1) + c*f*(p + 1)) - 2*a*b*d*(d*e*
(n + 1) + c*f*(p + 1)) - b^2*d*(d*e - c*f)*(n + 1)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && (LtQ
[n, -1] || (EqQ[n + p + 3, 0] && NeQ[n, -1] && (SumSimplerQ[n, 1] ||  !SumSimplerQ[p, 1])))

Rule 214

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x/Rt[-a/b, 2]], x] /; FreeQ[{a, b},
x] && NegQ[a/b]

Rule 382

Int[((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> -Subst[Int[(a + b/x^n)^p*((c +
 d/x^n)^q/x^2), x], x, 1/x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && ILtQ[n, 0]

Rubi steps

\begin {align*} \int \frac {\left (c+\frac {d}{x}\right )^2}{\sqrt {a+\frac {b}{x}}} \, dx &=-\text {Subst}\left (\int \frac {(c+d x)^2}{x^2 \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )\\ &=\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}-\frac {\text {Subst}\left (\int \frac {-\frac {1}{2} c (b c-4 a d)+a d^2 x}{x \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )}{a}\\ &=-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}+\frac {(c (b c-4 a d)) \text {Subst}\left (\int \frac {1}{x \sqrt {a+b x}} \, dx,x,\frac {1}{x}\right )}{2 a}\\ &=-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}+\frac {(c (b c-4 a d)) \text {Subst}\left (\int \frac {1}{-\frac {a}{b}+\frac {x^2}{b}} \, dx,x,\sqrt {a+\frac {b}{x}}\right )}{a b}\\ &=-\frac {2 d^2 \sqrt {a+\frac {b}{x}}}{b}+\frac {c^2 \sqrt {a+\frac {b}{x}} x}{a}-\frac {c (b c-4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.15, size = 66, normalized size = 0.90 \begin {gather*} \frac {\sqrt {a+\frac {b}{x}} \left (-2 a d^2+b c^2 x\right )}{a b}+\frac {c (-b c+4 a d) \tanh ^{-1}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )}{a^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d/x)^2/Sqrt[a + b/x],x]

[Out]

(Sqrt[a + b/x]*(-2*a*d^2 + b*c^2*x))/(a*b) + (c*(-(b*c) + 4*a*d)*ArcTanh[Sqrt[a + b/x]/Sqrt[a]])/a^(3/2)

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(347\) vs. \(2(63)=126\).
time = 0.04, size = 348, normalized size = 4.77

method result size
risch \(-\frac {\left (a x +b \right ) \left (-b \,c^{2} x +2 a \,d^{2}\right )}{b a x \sqrt {\frac {a x +b}{x}}}+\frac {\left (\frac {2 c \ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x}\right ) d}{\sqrt {a}}-\frac {c^{2} \ln \left (\frac {\frac {b}{2}+a x}{\sqrt {a}}+\sqrt {a \,x^{2}+b x}\right ) b}{2 a^{\frac {3}{2}}}\right ) \sqrt {x \left (a x +b \right )}}{x \sqrt {\frac {a x +b}{x}}}\) \(132\)
default \(-\frac {\sqrt {\frac {a x +b}{x}}\, \left (-2 \sqrt {a \,x^{2}+b x}\, a^{\frac {5}{2}} d^{2} x^{2}-4 \sqrt {a \,x^{2}+b x}\, a^{\frac {3}{2}} b c d \,x^{2}-\ln \left (\frac {2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a^{2} b \,d^{2} x^{2}-2 \ln \left (\frac {2 \sqrt {a \,x^{2}+b x}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a \,b^{2} c d \,x^{2}-2 a^{\frac {5}{2}} \sqrt {x \left (a x +b \right )}\, d^{2} x^{2}+4 a^{\frac {3}{2}} \sqrt {x \left (a x +b \right )}\, b c d \,x^{2}-2 \sqrt {a}\, \sqrt {x \left (a x +b \right )}\, b^{2} c^{2} x^{2}+\ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a^{2} b \,d^{2} x^{2}-2 \ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) a \,b^{2} c d \,x^{2}+\ln \left (\frac {2 \sqrt {x \left (a x +b \right )}\, \sqrt {a}+2 a x +b}{2 \sqrt {a}}\right ) b^{3} c^{2} x^{2}+4 \left (a \,x^{2}+b x \right )^{\frac {3}{2}} a^{\frac {3}{2}} d^{2}\right )}{2 x \sqrt {x \left (a x +b \right )}\, b^{2} a^{\frac {3}{2}}}\) \(348\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d/x)^2/(a+1/x*b)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*((a*x+b)/x)^(1/2)/x*(-2*(a*x^2+b*x)^(1/2)*a^(5/2)*d^2*x^2-4*(a*x^2+b*x)^(1/2)*a^(3/2)*b*c*d*x^2-ln(1/2*(2
*(a*x^2+b*x)^(1/2)*a^(1/2)+2*a*x+b)/a^(1/2))*a^2*b*d^2*x^2-2*ln(1/2*(2*(a*x^2+b*x)^(1/2)*a^(1/2)+2*a*x+b)/a^(1
/2))*a*b^2*c*d*x^2-2*a^(5/2)*(x*(a*x+b))^(1/2)*d^2*x^2+4*a^(3/2)*(x*(a*x+b))^(1/2)*b*c*d*x^2-2*a^(1/2)*(x*(a*x
+b))^(1/2)*b^2*c^2*x^2+ln(1/2*(2*(x*(a*x+b))^(1/2)*a^(1/2)+2*a*x+b)/a^(1/2))*a^2*b*d^2*x^2-2*ln(1/2*(2*(x*(a*x
+b))^(1/2)*a^(1/2)+2*a*x+b)/a^(1/2))*a*b^2*c*d*x^2+ln(1/2*(2*(x*(a*x+b))^(1/2)*a^(1/2)+2*a*x+b)/a^(1/2))*b^3*c
^2*x^2+4*(a*x^2+b*x)^(3/2)*a^(3/2)*d^2)/(x*(a*x+b))^(1/2)/b^2/a^(3/2)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs. \(2 (63) = 126\).
time = 0.50, size = 129, normalized size = 1.77 \begin {gather*} \frac {1}{2} \, c^{2} {\left (\frac {2 \, \sqrt {a + \frac {b}{x}} b}{{\left (a + \frac {b}{x}\right )} a - a^{2}} + \frac {b \log \left (\frac {\sqrt {a + \frac {b}{x}} - \sqrt {a}}{\sqrt {a + \frac {b}{x}} + \sqrt {a}}\right )}{a^{\frac {3}{2}}}\right )} - \frac {2 \, c d \log \left (\frac {\sqrt {a + \frac {b}{x}} - \sqrt {a}}{\sqrt {a + \frac {b}{x}} + \sqrt {a}}\right )}{\sqrt {a}} - \frac {2 \, \sqrt {a + \frac {b}{x}} d^{2}}{b} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d/x)^2/(a+b/x)^(1/2),x, algorithm="maxima")

[Out]

1/2*c^2*(2*sqrt(a + b/x)*b/((a + b/x)*a - a^2) + b*log((sqrt(a + b/x) - sqrt(a))/(sqrt(a + b/x) + sqrt(a)))/a^
(3/2)) - 2*c*d*log((sqrt(a + b/x) - sqrt(a))/(sqrt(a + b/x) + sqrt(a)))/sqrt(a) - 2*sqrt(a + b/x)*d^2/b

________________________________________________________________________________________

Fricas [A]
time = 2.50, size = 158, normalized size = 2.16 \begin {gather*} \left [-\frac {{\left (b^{2} c^{2} - 4 \, a b c d\right )} \sqrt {a} \log \left (2 \, a x + 2 \, \sqrt {a} x \sqrt {\frac {a x + b}{x}} + b\right ) - 2 \, {\left (a b c^{2} x - 2 \, a^{2} d^{2}\right )} \sqrt {\frac {a x + b}{x}}}{2 \, a^{2} b}, \frac {{\left (b^{2} c^{2} - 4 \, a b c d\right )} \sqrt {-a} \arctan \left (\frac {\sqrt {-a} \sqrt {\frac {a x + b}{x}}}{a}\right ) + {\left (a b c^{2} x - 2 \, a^{2} d^{2}\right )} \sqrt {\frac {a x + b}{x}}}{a^{2} b}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d/x)^2/(a+b/x)^(1/2),x, algorithm="fricas")

[Out]

[-1/2*((b^2*c^2 - 4*a*b*c*d)*sqrt(a)*log(2*a*x + 2*sqrt(a)*x*sqrt((a*x + b)/x) + b) - 2*(a*b*c^2*x - 2*a^2*d^2
)*sqrt((a*x + b)/x))/(a^2*b), ((b^2*c^2 - 4*a*b*c*d)*sqrt(-a)*arctan(sqrt(-a)*sqrt((a*x + b)/x)/a) + (a*b*c^2*
x - 2*a^2*d^2)*sqrt((a*x + b)/x))/(a^2*b)]

________________________________________________________________________________________

Sympy [A]
time = 24.78, size = 114, normalized size = 1.56 \begin {gather*} d^{2} \left (\begin {cases} - \frac {1}{\sqrt {a} x} & \text {for}\: b = 0 \\- \frac {2 \sqrt {a + \frac {b}{x}}}{b} & \text {otherwise} \end {cases}\right ) + \frac {\sqrt {b} c^{2} \sqrt {x} \sqrt {\frac {a x}{b} + 1}}{a} - \frac {4 c d \operatorname {atan}{\left (\frac {1}{\sqrt {- \frac {1}{a}} \sqrt {a + \frac {b}{x}}} \right )}}{a \sqrt {- \frac {1}{a}}} - \frac {b c^{2} \operatorname {asinh}{\left (\frac {\sqrt {a} \sqrt {x}}{\sqrt {b}} \right )}}{a^{\frac {3}{2}}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d/x)**2/(a+b/x)**(1/2),x)

[Out]

d**2*Piecewise((-1/(sqrt(a)*x), Eq(b, 0)), (-2*sqrt(a + b/x)/b, True)) + sqrt(b)*c**2*sqrt(x)*sqrt(a*x/b + 1)/
a - 4*c*d*atan(1/(sqrt(-1/a)*sqrt(a + b/x)))/(a*sqrt(-1/a)) - b*c**2*asinh(sqrt(a)*sqrt(x)/sqrt(b))/a**(3/2)

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d/x)^2/(a+b/x)^(1/2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Warning, integration of abs or sign assumes constant sign by intervals (correct if the argument is real):Ch
eck [abs(sa

________________________________________________________________________________________

Mupad [B]
time = 1.62, size = 63, normalized size = 0.86 \begin {gather*} \frac {c^2\,x\,\sqrt {a+\frac {b}{x}}}{a}-\frac {2\,d^2\,\sqrt {a+\frac {b}{x}}}{b}+\frac {c\,\mathrm {atanh}\left (\frac {\sqrt {a+\frac {b}{x}}}{\sqrt {a}}\right )\,\left (4\,a\,d-b\,c\right )}{a^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d/x)^2/(a + b/x)^(1/2),x)

[Out]

(c^2*x*(a + b/x)^(1/2))/a - (2*d^2*(a + b/x)^(1/2))/b + (c*atanh((a + b/x)^(1/2)/a^(1/2))*(4*a*d - b*c))/a^(3/
2)

________________________________________________________________________________________